// 文章相关
import request from '@/utils/request'

/**
 * 获取新闻列表
 * @param {*} id 频道id
 * @param {*} timestamp 时间戳
 * @returns
 */
export function getArticle(id, timestamp) {
  return request({
    url: '/v1_0/articles',
    params: {
      channel_id: id,
      timestamp
    }
  })
}

/**
 * 对文章不喜欢(不感兴趣)
 * @param {*} target 不喜欢的文章id
 * @returns
 */
export const disLikeArticle = target => {
  return request({
    method: 'post',
    url: '/v1_0/article/dislikes',
    data: {
      target
    }
  })
}

/**
 * 举报文章
 * @param {*} target 举报的文章id
 * @param {*} type 举报类型
 * @returns
 */
export function reportArticle(target, type) {
  return request({
    url: '/v1_0/article/reports',
    method: 'post',
    data: {
      target,
      type
    }
  })
}
